import request from "@/utils/request";
import { param } from "@/utils";
/**
 * 报销借款分类树
 */
export const getLoanTree = () => {
    return request({
      url: "/finance/billCategory/tree"
    });
}

/**
* 根据审批id获取表单数据
*/
export const getFormData = (formId) => {
 return request({
   url: `/process/model/detail/${formId}`
 })
}

/**
* 获取账号
*/
export const getAccount = () => {
 return request({
   url: `/finance/partnerAccount/loginAccount`
 })
}
/**
* 添加账号
*/
export const addAccount = (data) => {
 return request({
   url: `/finance/partnerAccount/addAccountByLoginUser`,
   method: 'post',
   data
 })
}
/**
 * 全部
 */
export const getAllList = (query, data) => {
  return request({
    url: `/finance/billCategoryNote/page?${param(query)}`,
    method: 'post',
    data

  })
}

/**
 * 获取表单数据详情
 */
export const getFormDetail = (instanceId) => {
  return request({
    url: `/process/instance/progress/${instanceId}/undefined`
  })
}

/**
 * 删除
 */
export const del=(type,billNoteId)=>{
  return request({
    url: `/finance/billCategoryNote/remove/${type}/${billNoteId}`
  })
}
/**
 * 详情
 */
export const getDetail = (noteId) => {
  return request({
      url: `/finance/billCategoryNote/detail/${noteId}`,
      method: 'post'
  })
}

/**
 * 获取申请列表
 */
export const getApplicationList = (query,data) => {
  return request({
    url: `/finance/slipApply/page?${param(query)}`,
    method:'post',
    data
  });
}


/**
* 删除申请单1.0
*/
export const delApplication=(applyId)=>{
  return request({
      url:`/finance/slipApply/remove/${applyId}`,
  })
}

/**
 * 删除申请单2.0
 */
export const delApply=(type,billNoteId)=>{
  return request({
      url:`/finance/billCategoryNote/remove/${type}/${billNoteId}`,
  })
}